<template>
  <img :src="showIcon" />
</template>
<script setup lang="ts">
import { getIconUrl } from "@/assets/images";
import { computed } from "vue";

defineOptions({
  name: "ImgIcon"
})

const props = defineProps({ 
  folder: {
    type: String,
    default: "",
  },
  icon: {
    type: String,
    default: "index",
  },
  hasSuffix: {
    type: Boolean,
    default: false,
  }
});

const showIcon = computed(() => {
  return getIconUrl(props.folder, props.icon, props.hasSuffix);
});
</script>
